Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

combo-storage

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

combo-storage

The package allows you to manage data in LocalStorage, SessionStorage and Cookies

  • 1.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
599
decreased by-1.16%
Maintainers
1
Weekly downloads
 
Created
Source

combo-storage

Table of contents

  • Installation
  • Getting started
  • Base methods for LocalStorage and SessionStorage
  • Additional methods for LocalStorage and SessionStorage
  • Cookie methods

Installation

You need to install package.

npm install combo-storage

Getting started

You should import the required storages to use the package

import { LocalStorage, SeessionStorage, Cookie } from 'combo-storage'

Then use the methods of storage. For example:

LocalStorage.set('user', 'awibox');

Base methods for LocalStorage and SessionStorage

set
LocalStorage.set(key, value);
SessionStorage.set(key, value);
get
LocalStorage.get(key);
SessionStorage.get(key);
remove
LocalStorage.remove(key);
SessionStorage.remove(key);
сlear
LocalStorage.clear();
SessionStorage.clear();

Additional methods for LocalStorage and SessionStorage

You can now save objects and arrays

setObject
var object = {
    id: 1,
    value: 'object'
};
LocalStorage.setObject(key, object);
SessionStorage.setObject(key, object);
getObject
LocalStorage.getObject(key);
SessionStorage.getObject(key);

set
// Options for example
var options = {
    path: '/',
    expires: Date(),
    'max-age': 3600,
    secure: true,
    domain: 'domain.com'
};
Cookie.set(name, value, options);
get
Cookie.get(name)
remove
Cookie.remove(name)

Keywords

FAQs

Package last updated on 19 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc